package com.ssm.hj.controller;

import com.github.pagehelper.PageInfo;
import com.ssm.hj.page.Page;
import com.ssm.hj.search.RoleSearch;
import com.ssm.hj.service.RoleService;
import com.ssm.pojo.Role;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class RoleController {
    @Resource
    private RoleService roleService;
    //  阿杰 查询所有角色
    @RequestMapping("/hj/queryRoleAll")
    public PageInfo<Role> queryRoleAll(@RequestBody Page<RoleSearch> page) throws Exception {
        return this.roleService.queryRoleAllService(page);
    }
    // 阿杰 修改角色状态
    @RequestMapping("/hj/updateRoleState")
    public int updateRoleState(int id,int state) throws Exception {
        return this.roleService.updateRoleStateService(id,state);
    }
}
